<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" href="../style/journal.css" type="text/css" />
<style type="text/css"><!--
.googleadsense {
	margin: 2px;
	padding: 0px;
//--></style><script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-65008-1";
urchinTracker();
</script><title>Text::Textile</title>
</head>
<body>
<a href="index.html">Journal</a>(2005) | <a href="../blog/"><b>Blog</b></a>(2006) | <a href="http://www.fayland.org/cgi-bin/random_link.pl">RandomLink</a> | <a href="AboutFayland.html">WhoAmI</a> | <a href="LiveBookmark.html">LiveBookmark</a> | <a href="http://www.fayland.org/">HomePage</a>
<p><&lt;Previous: <a href="GoogleGroup.html">WWW::Mechanize && Google Group</a>&nbsp;&nbsp;>>Next: <a href="Kwiki_formatter.html">Kwiki Formatter</a></p>
<h1>Text::Textile</h1>
<div class='content'>
<p>Category: <a href='Modules.html'>Modules</a> &nbsp; Keywords: <b>textile</b></p><p><strong>Textile</strong> 是种 wiki 常用的格式，写起来比较方便。 <a href="http://wiki.perlchina.org">perlchina wiki</a> 用的就是这个格式。</p>

<p><a href="http://search.cpan.org"><span class="caps">CPAN</span></a> 上有个模块为 <a href='http://search.cpan.org/perldoc?Text::Textile'>Text::Textile</a> 可以实现这个功能。于是想着给 Eplanet 增加这功能。</p>

<p>代码还是很简单：</p>



<pre>
use Text::Textile;
my $textile = Text::Textile-&gt;new();
$textile-&gt;charset('utf-8');

$c-&gt;stash-&gt;{cms_text} = $textile-&gt;process( $c-&gt;stash-&gt;{cms_text} );
</pre>



<p>唯一值得一写的是如果是 utf-8 格式数据的话就得多一句</p>



<pre>$textile-&gt;charset('utf-8');</pre>



<p>Have fun. Enjoy!</p>

<h2>Refer</h2>

<ul>
<li><a href="http://hobix.com/textile">A Textile Reference</a></li>
</ul></div>
<p><&lt;Previous: <a href="GoogleGroup.html">WWW::Mechanize && Google Group</a>&nbsp;&nbsp;>>Next: <a href="Kwiki_formatter.html">Kwiki Formatter</a></p>
<p><strong>Options:</strong> <a href='http://del.icio.us/post?title=Text::Textile&url=http://www.fayland.org/journal/textile.html'>+Del.icio.us</a></p>
<strong>Related items</strong>
<ul><li><a href='GoogleGroup.html'>WWW::Mechanize && Google Group</a> < <span class='digit'>2005-04-13 18:49:43</span> ></li><li><a href='050528.html'>Google Print</a> < <span class='digit'>2005-05-28 14:50:57</span> ></li><li><a href='google_sitemap.html'>Google Sitemap</a> < <span class='digit'>2005-06-04 22:52:44</span> ></li><li><a href='NewsGroup.html'>我的新闻组设置过程</a> < <span class='digit'>2004-10-30 19:12:46</span> ></li></ul>
Created on <span class="digit">2005-04-14 18:49:04</span>, Last modified on <span class="digit">2005-04-14 19:21:56</span><br />
Copyright 2004-2005 All Rights Reserved. Powered by <a href="Eplanet.html">Eplanet</a> && <a href='http://catalyst.perl.org'>Catalyst</a> 5.62.
</body>
</html>